﻿package com.firewolf.state.states;

import com.firewolf.state.context.GumballMachine;
/**
 * 有钱的状态
 * @author Administrator
 *
 */
public class HasMoneyState implements IState {
	
	private GumballMachine gumballMachine;
	
	public HasMoneyState(GumballMachine gumballMachine) {
		this.gumballMachine = gumballMachine;
	}
	@Override
	public void insert25tMoney() {
		System.out.println("你已经投币了，不用再投了！");
	}

	@Override
	public void ejectMoney() {
		System.out.println("给你退钱-----");
		gumballMachine.setState(gumballMachine.getNoMoneyState());
	}

	@Override
	public void turnCrank() {
		System.out.println("你转动了曲柄---");
		gumballMachine.setState(gumballMachine.getSoldState());
	}

	@Override
	public void dispense() {
		System.out.println("没有糖果发放！");
	}

}
